home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\DOC\TEST-SUI.C < prev    next >
C/C++ Source or Header  |  1994-12-28  |  555b  |  18 lines

  1. /* To use this test program, compile it with "cc -otest-suid test-suid.c",
  2.  * change its ownership to root and mode 4711, and run it as a
  3.  * mortal user. IF the results show that it was able to set the
  4.  * EUID back to 0, you can use the PRIV_PORT_ULC version of the
  5.  * privileged port code, which is trivially proven to be secure.
  6.  */
  7. #include <stdio.h>
  8.  
  9. main()
  10. {
  11.  
  12.     printf("Starting EUID = %d\n", geteuid());
  13.     seteuid(getuid());
  14.     printf("After seteuid to %d is %d\n", getuid(), geteuid());
  15.     seteuid(0);
  16.     printf("After seteuid to 0 is %d\n", geteuid());
  17. }
  18.